/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Mapper;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author ITCreed
 */
public class PublisherMapper extends DBMapper {
    public PublisherMapper() throws SQLException, Exception {
        super();
    }
    public Bean.PublisherBean GetInfo(String id) throws Exception {
        Bean.PublisherBean pb = new Bean.PublisherBean();
        PreparedStatement stmt = getConnection().prepareStatement("SELECT * FROM Publisher WHERE ID='" + id + "'");
        ResultSet rs = stmt.executeQuery();
        if (rs != null && rs.next()) {
            pb.setID(rs.getString(1));
            pb.setName(rs.getString(2));
        }
        stmt.close();
        return pb;
    }
}
